<html><head>
<meta charset="utf-8" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<?php
include "seggeneral.php";
?>
</head><body>
<form action ='add_personal2.php' method = 'POST' ENCTYPE="multipart/form-data" name='frmdo' id='frmdo' target='_self'>
<table align='center' border='1'>
	<tbody>
		<tr>
			<td>Nombre:</td>
			<td><input type='text' name='nombre' placeholder='Juan' required/></td>
		</tr>
		<tr>
			<td>Apellido Paterno:</td>
			<td><input type='text' name='ap' placeholder='Barrera' required/></td>
		</tr>
		<tr>
			<td>Apellido Materno:</td>
			<td><input type='text' name='am' placeholder='Diaz' required/></td>
		</tr>
		<tr>
			<td>Estado:</td>
			<td>
			<select name='estado' id='estado'>
			<?php
				include "db.php";
				$sql="SELECT * FROM `st_estados` order by nombre";
				$result = mysql_query($sql) or die( mysql_error());	
				
				while ($fila = mysql_fetch_assoc($result)) {
				echo"<option value='". $fila['estado_id'] ."'>". $fila['nombre'] ."</option>";
				}
			?>
			</select>
</td>
		</tr>
		<tr>
			<td colspan='2'><div id="ajax"></div></td>
		</tr>
		<tr>
			<td>Calle:</td>
			<td><input type='text' name='calle' placeholder='Revolución'></td>
		</tr>
		<tr>
			<td>Número:</td>
			<td><input type='text' name='num' placeholder='277'></td>
		</tr>
		<tr>
			<td>Codigo Postal:</td>
			<td><input type='text' name='cp' placeholder='50200'></td>
		</tr>
		<tr>
			<td>Telefono:</td>
			<td><input type='text' name='tel' placeholder='722 338 7849'></td>
		</tr>
		<tr>
			<td>E-mail:</td>
			<td><input type='text' name='email' placeholder='algo@dominio.com' required></td>
		</tr>
		<tr>
			<td>Repetir e-mail:</td>
			<td><input type='text' name='remail' autocomplete="off" required></td>
		</tr>
		<tr>
			<td>Contraseña:</td>
			<td><input type='password' name='contra' placeholder='mayor a 6 caracteres'required></td>
		</tr>
		<tr>
			<td>Repetir contraseña:</td>
			<td><input type='password' name='rcontra' autocomplete="off" required></td>
		</tr>
		<tr>
			<td>Twitter:</td>
			<td><input type='text' name='twit' placeholder='http://twitter.com/hunabmoy'></td>
		</tr>
		<tr>
			<td>Foto:</td>
			<td><input type='file' name='foto' ></td>
		</tr>
	</tbody>
</table>
<center><a href ='add_personal2.php'><input type=submit value='Guardar'></a></center>
</form>
<script type="text/javascript" >
$(function () {
		$('#estado').click(function()
	{
		$('#ajax').load('municipio.php?estado=' + this.options[this.selectedIndex].value)
	})	
})
</script>
</body></html>